home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1993 November / JCSM Shareware Collection - 1993-11.iso / cl720 / sst115j.lzh / MSCDEMO.C < prev    next >
C/C++ Source or Header  |  1992-08-01  |  2KB  |  58 lines

  1. /* ------------------------------------------------------------------------ */
  2. /*                        demo on miscellaneous stuff                       */
  3. /* ------------------------------------------------------------------------ */
  4. #include <stdio.h>
  5. #include <conio.h>
  6.  
  7. #include "sstvid.h"
  8. #include "sstwin.h"
  9. #include "sstkey.h"
  10.  
  11. void main     (void);
  12. void kbddemo  (void);
  13.  
  14.  
  15. /* ------------------------------------------------------------------------ */
  16. /*                           demo of keyboard functions                     */
  17. /* ------------------------------------------------------------------------ */
  18. void kbddemo(void)
  19.  
  20. {
  21.  int far *c, ch = 0;
  22.  
  23.  vputs(0,1,LIGHTGREEN,"Keyboard status demonstarion.");
  24.  vputs(0,4,7,"Toggle status ----------------------");
  25.  vputs(0,5,7,"------------------------------------");
  26.  vputs(0,13,7,"Momentary status-------------------");
  27.  vputs(0,14,7,"-----------------------------------");
  28.  
  29.  while (ch != ESC) {
  30.    vputtime(71,0,WHITE,1);
  31.    c = kstate();
  32.    vputf(0,7,3,"Scroll-lock   - %s",((*c & K_SCROLLLOCKON ) ? " ON" : "OFF"));
  33.    vputf(0,8,3,"Num-lock      - %s",((*c & K_NUMLOCKON ) ? " ON" : "OFF"));
  34.    vputf(0,9,3,"Caps-lock     - %s",((*c & K_CAPSLOCKON ) ? " ON" : "OFF"));
  35.    vputf(0,10,3,"Insert        - %s",((*c & K_INSON ) ? " ON" : "OFF"));
  36.    vputf(0,11,3,"Ctrl Num-lock - %s",((*c & K_SUSPENDON) ? " ON" : "OFF"));
  37.    vputf(0,16,14,"Left  shift   - %s",((*c & K_LEFTSHIFTDOWN) ? "DOWN" : "    "));
  38.    vputf(0,17,14,"Right shift   - %s",((*c & K_RIGHTSHIFTDOWN ) ? "DOWN" : "    "));
  39.    vputf(0,18,14,"Ctrl          - %s",((*c & K_CTRLDOWN) ? "DOWN" : "    "));
  40.    vputf(0,19,14,"Alt           - %s",((*c & K_ALTDOWN ) ? "DOWN" : "    "));
  41.    vputf(0,20,14,"Scroll        - %s",((*c & K_SCROLLLOCKDOWN ) ? "DOWN" : "    "));
  42.    vputf(0,21,14,"Num-lock      - %s",((*c & K_NUMLOCKDOWN ) ? "DOWN" : "    "));
  43.    vputf(0,22,14,"Caps-lock     - %s",((*c & K_CAPSLOCKDOWN ) ? "DOWN" : "    "));
  44.    vputf(0,23,14,"Insert        - %s",((*c & K_INSDOWN ) ? "DOWN" : "    "));
  45.    if (kkeyhit())
  46.        ch = kgetch();
  47.  }
  48.  
  49. }
  50. /* ------------------------------------------------------------------------ */
  51. void main(void)
  52.  
  53. {
  54.  clrscr();
  55.  vputdate(58,0,WHITE,2);
  56.  kbddemo();
  57. }
  58.